home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / fastscr.com / FAST.DOC < prev    next >
Encoding:
Text File  |  1989-06-29  |  33.8 KB  |  727 lines

  1.  
  2.  
  3.  
  4.                                  FASTSCRN version 1.0
  5.  
  6.      The FASTSCRN unit (and the related FASTDEF unit) is designed to provide
  7.      simple and fast video control through the use of objects.  Some features
  8.      include: memory screens, option of selecting a color or using previous
  9.      color, snow avoidance, copying between screens, changing attributes, cursor
  10.      control, multiple video page support, and multiple video mode support.
  11.  
  12.      Section One: FASTSCRN Interface. . . . . . . . . . . . . . . . . . . . .  2
  13.      Section Two: FASTDEF Interface . . . . . . . . . . . . . . . . . . . . .  4
  14.      Section Three: ScreenObj Description . . . . . . . . . . . . . . . . . .  6
  15.           Rows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  16.           Cols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  17.           LastRow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  18.           LastCol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  19.           ScrPtr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  20.           Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  6
  21.           Done. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  22.           Snow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  23.           ScreenPtr . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  24.           Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  25.           WriteV. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  26.           WriteA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  7
  27.           WriteAv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  28.           WriteC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  29.           WriteAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  30.           WriteCv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  31.           WriteACv. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  32.           Fill. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
  33.           Attr. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  34.           CharAt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  35.           ColorAt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  36.           Copy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  37.           SetLasts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  9
  38.      Section Four: DisplayObj . . . . . . . . . . . . . . . . . . . . . . . . 10
  39.           ScreenType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  40.           ScreenSnow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  41.           Page. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  42.           Init. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  43.           Snow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  44.           CurrentRows . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
  45.           CurrentCols . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  46.           CurrentVideoMode. . . . . . . . . . . . . . . . . . . . . . . . . . 11
  47.           SetVideoMode. . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  48.           SetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  49.           GetCursor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  50.           CursorOff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  51.           CursorOn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  52.           WhereR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  53.           WhereC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  54.           GotoRC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
  55.           UsePage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  56.           DisplayPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
  57.      Section Five: Examples . . . . . . . . . . . . . . . . . . . . . . . . . 13
  58.           Writing to the screen . . . . . . . . . . . . . . . . . . . . . . . 13
  59.                Centering. . . . . . . . . . . . . . . . . . . . . . . . . . . 13
  60.                Specifying colors. . . . . . . . . . . . . . . . . . . . . . . 13
  61.                Using LastRow and LastCol. . . . . . . . . . . . . . . . . . . 13
  62.           Copying to and from screens . . . . . . . . . . . . . . . . . . . . 14
  63.      Section Six: Public Domain . . . . . . . . . . . . . . . . . . . . . . . 15
  64.      FASTSCRN documentation                                               Page 2
  65.  
  66.  
  67.      Section One: FASTSCRN Interface
  68.      ------------ ------------------
  69.  
  70.      ScreenObj =    Object
  71.                          Rows,Cols :    Byte;
  72.                          LastRow,
  73.                          LastCol   :    Byte;
  74.                          ScrPtr    :    Pointer;
  75.  
  76.                          Constructor Init;
  77.                          Destructor Done;
  78.  
  79.                          Function Snow:Boolean;
  80.                          Function ScreenPtr(Row, Col:Byte):Pointer;
  81.  
  82.                          Procedure Write(Row, Col:Byte; Color:Integer;
  83.                               St:String);
  84.                          Procedure WriteV(Row, Col:Byte;
  85.                               Color:Integer; St:String);
  86.                          Procedure WriteA(Row, Col:Byte;
  87.                               Color:Integer; Var St; Len:Byte);
  88.                          Procedure WriteAv(Row, Col:Byte;
  89.                               Color:Integer; Var St; Len:Byte);
  90.                          Procedure WriteC(Row, Col1, Col2:Byte;
  91.                               Color:Integer; St:String);
  92.                          Procedure WriteAC(Row, Col1, Col2:Byte;
  93.                               Color:Integer; Var St; Len:Byte);
  94.                          Procedure WriteCv(Row1, Row2, Col:Byte;
  95.                               Color:Integer; St:String);
  96.                          Procedure WriteACv(Row1, Row2, Col:Byte;
  97.                               Color:Integer; Var St; Len:Byte);
  98.  
  99.                          Procedure Fill(Row, Col, Rows, Cols:Byte;
  100.                               Color:Integer; Ch:Char);
  101.                          Procedure Color(Row, Col, Rows, Cols:Byte;
  102.                               Color:Integer; Ch:Char);
  103.  
  104.                          Function CharAt(Row, Col:Byte):Char;
  105.                          Function ColorAt(Row, Col:Byte):Byte;
  106.  
  107.                          Procedure Copy(SourceScreen:ScreenObj;
  108.                               SourceRow, SourceCol, SourceRows,
  109.                               SourceCols, DestRow, DestCol:Byte);
  110.  
  111.                          Procedure SetLasts(Rows, Cols:Byte);
  112.                     End;
  113.  
  114.      DisplayObj=    Object (ScreenObj)
  115.                          ScreenType     :    Byte;
  116.                          ScreenSnow     :    Boolean;
  117.                          Page           :    Byte;
  118.  
  119.                          Constructor Init;
  120.  
  121.                          Function Snow:Boolean;
  122.  
  123.                          Function CurrentRows:Byte;
  124.                          Function CurrentCols:Byte;
  125.                          Function CurrentVideoMode:Byte;
  126.                          Procedure SetVideoMode(Mode:Byte);
  127.      FASTSCRN documentation                                               Page 3
  128.  
  129.  
  130.                          Procedure SetCursor(Top,Bottom:Byte);
  131.                          Function GetCursor:Word;
  132.                          Procedure CursorOn;
  133.                          Procedure CursorOff;
  134.                          Function WhereR:Byte;
  135.                          Function WhereC:Byte;
  136.                          Function GotoRC(Row, Col:Byte);
  137.  
  138.                          Procedure UsePage(PageNum:Byte);
  139.                          Procedure DisplayPage(PageNum:Byte);
  140.                          Function CurrentPage:Byte;
  141.                     End;
  142.  
  143.      Var
  144.           DisplayScreen            :    DisplayObj;
  145.  
  146.      NOTE:The DisplayScreen variable is automatically set to the current video
  147.           display when your program is first run, therefore ALL writes to the
  148.           screen should go through DisplayScreen.
  149.  
  150.           Although not shown, ALL methods (except Constructors, of course) are
  151.           declared as VIRTUAL for easy extensibility.
  152.      FASTSCRN documentation                                               Page 4
  153.  
  154.  
  155.      Section Two: FASTDEF interface
  156.      ------------ -----------------
  157.      Type
  158.           BorderTypes              =   (NoBrdr,
  159.                                         SpaceBrdr, SingleBrdr, DoubleBrdr,
  160.                                         HorizDoubleVertSingleBrdr,
  161.                                         HorizSingleVertDoubleBrdr,
  162.                                         BlockBrdr,
  163.                                         Hatch1Brdr, Hatch2Brdr, Hatch3Brdr,
  164.                                         SmallDotBrdr, MedDotBrdr, BigDotBrdr,
  165.                                         User1Brdr, User2Brdr, User3Brdr
  166.                                        );
  167.         Borders                   =   (HorizTop, HorizBottom,
  168.                                        VertLeft, VertRight, HorizBorders,
  169.                                        VertBorders, AllBorders);
  170.         BorderParts               =   (TL,TR,BL,BR,HT,HB,VR,VL,LC,RC,TC,BC,CC);
  171.  
  172.      The positions for these are as follows:
  173.           TL HT TC HT TR
  174.           VL          VR
  175.           LC HT CC HT RC
  176.           VL          VR
  177.           BL HB BC HB BR
  178.  
  179.      The mnemonics corrspond to the following:
  180.           TL   :    Top left corner
  181.           TR   :    Top right corner
  182.           BL   :    Bottom left corner
  183.           BR   :    Bottom right corner
  184.           HT   :    Horizontal top line
  185.           HB   :    Horizontal bottom line
  186.           VR   :    Vertical right line
  187.           VL   :    Vertical left line
  188.           LC   :    Left connecting piece
  189.           RC   :    Right connecting piece
  190.           TC   :    Top connecting piece
  191.           BC   :    Bottom connecting piece
  192.           CC   :    Center connecting piece
  193.  
  194.         BorderArray               =   Array[TL..CC] of Char;
  195.  
  196.      Const
  197.         Black                     =   $0;
  198.         Blue                      =   $1;
  199.         Green                     =   $2;
  200.         Cyan                      =   $3;
  201.         Red                       =   $4;
  202.         Magenta                   =   $5;
  203.         Brown                     =   $6;
  204.         LightGray                 =   $7;
  205.         DarkGray                  =   $8;
  206.         LightBlue                 =   $9;
  207.         LightGreen                =   $A;
  208.         LightCyan                 =   $B;
  209.         LightRed                  =   $C;
  210.         LightMagenta              =   $D;
  211.         Yellow                    =   $E;
  212.         White                     =   $F;
  213.         Blink                     =   $80;
  214.         BlackBG                   =   $0;
  215.      FASTSCRN documentation                                               Page 5
  216.  
  217.  
  218.         BlueBG                    =   $10;
  219.         GreenBG                   =   $20;
  220.         CyanBG                    =   $30;
  221.         RedBG                     =   $40;
  222.         MagentaBG                 =   $50;
  223.         BrownBG                   =   $60;
  224.         LightGrayBG               =   $70;
  225.         SameAttr                  =   -1;
  226.         SameColor                 =   SameAttr;
  227.  
  228.         NoDisplay                 =   $0;
  229.         MDAmono                   =   $1;
  230.         CGAcolor                  =   $2;
  231.         DCC3                      =   $3;
  232.         EGAcolor                  =   $4;
  233.         EGAmono                   =   $5;
  234.         PGCcolor                  =   $6;
  235.         VGAmono                   =   $7;
  236.         VGAcolor                  =   $8;
  237.         DCC9                      =   $9;
  238.         DCC10                     =   $A;
  239.         MCGAmono                  =   $B;
  240.         MCGAcolor                 =   $C;
  241.         Unknown                   =   $FF;
  242.  
  243.         BorderSt                  :   Array [SpaceBrdr..User3Brdr] of
  244.                                       BorderArray=
  245.                                    ('█████████████', SpaceBrdr
  246.                                     '┌┐└┘──││├┤┬┴┼', SingleBrdr
  247.                                     '╔╗╚╝══║║╠╣╦╩╬', DoubleBrdr
  248.                                     '╒╕╘╛══││╞╡╤╧╪', HorizDoubleVertSingleBrdr
  249.                                     '╓╖╙╜──║║╟╢╥╙╫', HorizSingleVertDoubleBrdr
  250.                                     '▄▄▀▀▄▀▐▌▀▀▄▀■', BlockBrdr
  251.                                     '░░░░░░░░░░░░░', Hatch1Brdr
  252.                                     '▒▒▒▒▒▒▒▒▒▒▒▒▒', Hatch2Brdr
  253.                                     '▓▓▓▓▓▓▓▓▓▓▓▓▓', Hatch3Brdr
  254.                                     '·············', SmallDotBrdr
  255.                                     '∙∙∙∙∙∙∙∙∙∙∙∙∙', MedDotBrdr
  256.                                     #7#7#7#7#7#7#7#7#7#7#7#7#7, LargeDotBrdr
  257.                                     '             ', User1Brdr
  258.                                     '             ', User2Brdr
  259.                                     '             '); User3Brdr
  260.      FASTSCRN documentation                                               Page 6
  261.  
  262.  
  263.      Section Three: ScreenObj description
  264.      -------------- ---------------------
  265.      The ScreenObj object type is used for in-memory screens.  Normally, an in-
  266.      memory screen is used to store information from the main-screen, modify it
  267.      in some way, and then re-display back onto the screen.
  268.  
  269.      Because ScreenObj assumes it is in-memory, no snow checks are made.
  270.  
  271.           ----------------------------------------------------------------------
  272.           Rows:Byte
  273.           ----------------------------------------------------------------------
  274.           The Rows variable contains the number of rows the ScreenObj contains.
  275.  
  276.  
  277.           ----------------------------------------------------------------------
  278.           Cols:Byte
  279.           ----------------------------------------------------------------------
  280.           The Cols variable contains the number of columns per row that the
  281.           ScreenObj contains.
  282.  
  283.  
  284.           ----------------------------------------------------------------------
  285.           LastRow:Byte
  286.           ----------------------------------------------------------------------
  287.           The LastRow variable is set to the row last written on.
  288.  
  289.           LastRow is updated by all ScreenObj.Write procedures (including array
  290.           writes, vertical writes, and centered writes), ScreenObj.Fill
  291.           procedure and ScreenObj.Attr procedure.
  292.  
  293.  
  294.           ----------------------------------------------------------------------
  295.           LastCol:Byte
  296.           ----------------------------------------------------------------------
  297.           The LastCol variable is set to the column last written on.
  298.  
  299.           LastCol is updated by all ScreenObj.Write procedures (including array
  300.           writes, vertical writes, and centered writes), ScreenObj.Fill
  301.           procedure and ScreenObj.Attr procedure.
  302.  
  303.  
  304.           ----------------------------------------------------------------------
  305.           ScrPtr:Pointer
  306.           ----------------------------------------------------------------------
  307.           ScrPtr points to the location in memory where the screen (either
  308.           memory screen or actual video display) begins.
  309.  
  310.  
  311.           ----------------------------------------------------------------------
  312.           Constructor Init
  313.           ----------------------------------------------------------------------
  314.           The Init constructor must be called prior to any activity on that
  315.           screen.  Init sets up the Virtual Method Table (VMT) as well as
  316.           initialized LastRow and LastCol to 1.
  317.      FASTSCRN documentation                                               Page 7
  318.  
  319.  
  320.           ----------------------------------------------------------------------
  321.           Destructor Done
  322.           ----------------------------------------------------------------------
  323.           The Done destructor simply reclaims the memory used by the Virtual
  324.           Method Table (VMT).
  325.  
  326.  
  327.           ----------------------------------------------------------------------
  328.           Function Snow:Boolean
  329.           ----------------------------------------------------------------------
  330.           The ScreenObj.Snow function always returns False.
  331.  
  332.           This function will probably be eliminated in future releases of
  333.           FASTSCRN
  334.  
  335.  
  336.           ----------------------------------------------------------------------
  337.           Procedure Write(Row, Col, Color, StringToWrite)
  338.           ----------------------------------------------------------------------
  339.           Write will put StringToWrite at Row and Col on the ScreenObj.  Write
  340.           automatically takes care of the video page and snowing.
  341.  
  342.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  343.  
  344.  
  345.           ----------------------------------------------------------------------
  346.           Procedure WriteV(Row, Col, Color, StringToWrite)
  347.           ----------------------------------------------------------------------
  348.           WriteV will put StringToWrite VERTICALLY at Row and Col on the
  349.           ScreenObj.  WriteV automatically takes care of the video page and
  350.           snowing.
  351.  
  352.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  353.  
  354.  
  355.           ----------------------------------------------------------------------
  356.           Procedure WriteA(Row, Col, Color, ArrayToWrite, Len)
  357.           ----------------------------------------------------------------------
  358.           WriteA will put ArrayToWrite of length Len at Row and Col on the
  359.           ScreenObj.  WriteA automatically takes care of the video page and
  360.           snowing.
  361.  
  362.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  363.  
  364.  
  365.           ----------------------------------------------------------------------
  366.           Procedure WriteAv(Row, Col, Color, ArrayToWrite, Len)
  367.           ----------------------------------------------------------------------
  368.           WriteAv will put ArrayToWrite of length Len VERTICALLY at Row and Col
  369.           on the ScreenObj.  WriteA automatically takes care of the video page
  370.           and snowing.
  371.  
  372.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  373.      FASTSCRN documentation                                               Page 8
  374.  
  375.  
  376.           ----------------------------------------------------------------------
  377.           Procedure WriteC(Row, Col1, Col2, Color, StringToWrite)
  378.           ----------------------------------------------------------------------
  379.           WriteC will put StringToWrite on the ScreenObj centered between Col1
  380.           and Col2.  WriteC automatically takes care of the video page and
  381.           snowing.
  382.  
  383.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  384.  
  385.  
  386.           ----------------------------------------------------------------------
  387.           Procedure WriteAC(Row, Col1, Col2, Color, ArrayToWrite, Len)
  388.           ----------------------------------------------------------------------
  389.           WriteAC will put ArrayToWrite of length Len on the ScreenObj centered
  390.           between Col1 and Col2.  WriteAC automatically takes care of the video
  391.           page and snowing.
  392.  
  393.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  394.  
  395.  
  396.           ----------------------------------------------------------------------
  397.           Procedure WriteCv(Row1, Row2, Col, Color, StringToWrite)
  398.           ----------------------------------------------------------------------
  399.           WriteCv will put StringToWrite on the ScreenObj centered VERTICALLY
  400.           between Row1 and Row2.  WriteCv automatically takes care of the video
  401.           page and snowing.
  402.  
  403.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  404.  
  405.  
  406.  
  407.           ----------------------------------------------------------------------
  408.           Procedure WriteACv(Row1, Row2, Col, Color, ArrayToWrite,
  409.                Len)
  410.           ----------------------------------------------------------------------
  411.           WriteACv (yes, you guessed it!) will put ArrayToWrite on the ScreenObj
  412.           centered VERTICALLY between Row1 and Row2.  WriteACv (maybe you can
  413.           guess this part also) automatically takes care of the video page and
  414.           snowing.
  415.  
  416.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  417.  
  418.  
  419.           ----------------------------------------------------------------------
  420.           Procedure Fill(Row, Col, Rows, Cols, Color, FillChar)
  421.           ----------------------------------------------------------------------
  422.           Fill fills the ScreenObj from Row and Col for Rows number of rows and
  423.           Cols number of columns with the FillChar using the color of Color.
  424.           Fill automatically takes care of the video page and snowing.
  425.  
  426.           If Color is -1 (SameColor/SameAttr), the previous color will be used.
  427.  
  428.  
  429.           ----------------------------------------------------------------------
  430.           Procedure Color(Row, Col, Rows, Cols, Color)
  431.           ----------------------------------------------------------------------
  432.           Color will color from Row, Col for Rows number of Rows and Cols number
  433.           of columns the color of Color.  Color automatically takes care of the
  434.           video page and snowing.
  435.      FASTSCRN documentation                                               Page 9
  436.  
  437.  
  438.           ----------------------------------------------------------------------
  439.           Function CharAt(Row, Col):Char
  440.           ----------------------------------------------------------------------
  441.           CharAt returns the character at position Row, Col.
  442.  
  443.  
  444.           ----------------------------------------------------------------------
  445.           Function ColorAt(Row, Col):Byte
  446.           ----------------------------------------------------------------------
  447.           ColorAt returns the color at position Row, Col.
  448.  
  449.  
  450.  
  451.           ----------------------------------------------------------------------
  452.           Procedure SetLasts(Rows, Cols)
  453.           ----------------------------------------------------------------------
  454.           SetLasts sets the variables LastRow and LastCol.
  455.  
  456.           Should not normally be called by the program.
  457.      FASTSCRN documentation                                              Page 10
  458.  
  459.  
  460.      Section Four: DisplayObj
  461.      ------------- ----------
  462.      The DisplayObj object type is used for displaying information on the
  463.      screen.  Full snow checking and prevention is done with this object.
  464.      Normally there is only one DisplayObj and that is DisplayScreen (which is
  465.      initialized in the start-up code for the FASTSCRN unit), although multiple
  466.      screens can be handled by declaring more DisplayObjs and some virtual
  467.      methods.
  468.  
  469.           ----------------------------------------------------------------------
  470.           ScreenType:Byte
  471.           ----------------------------------------------------------------------
  472.           The variable ScreenType is initialized when DisplayObj.Init is called.
  473.           The detected video screen is stored in this variable.
  474.  
  475.           Currently, ScreenType can only be one of the following values:
  476.                VGAcolor, VGAmono, EGAcolor, EGAmono, CGAcolor, CGAmono
  477.           Although only the above screen types are detected, FASTSCRN defines
  478.           the following screen types also:
  479.                MDAmono, DCC3, PGCcolor, DCC9, DCC10, MCGAmono, MCGAcolor
  480.  
  481.  
  482.           ----------------------------------------------------------------------
  483.           ScreenSnow:Boolean
  484.           ----------------------------------------------------------------------
  485.           This variable stores TRUE if the DisplayObj snows during memory
  486.           writes,  or FALSE if it does not.  It is set during the
  487.           DisplayObj.Init process.
  488.  
  489.  
  490.           ----------------------------------------------------------------------
  491.           Page:Byte
  492.           ----------------------------------------------------------------------
  493.           This variable stores the current video page.
  494.  
  495.           This value should never be accessed by a program, use DisplayPage and
  496.           UsePage instead.
  497.  
  498.  
  499.           ----------------------------------------------------------------------
  500.           Constructor Init
  501.           ----------------------------------------------------------------------
  502.           Call DisplayObj.Init prior to any access to the screen.  This routine
  503.           detects the following video cards:
  504.                CGA, VGA, and EGA
  505.           It also determines whether or not the screen is color or monochrome
  506.           and if it snows.
  507.  
  508.           Note:  The DisplayScreen variable is automatically Init at the
  509.           beginning of the program.
  510.  
  511.  
  512.           ----------------------------------------------------------------------
  513.           Function CurrentRows:Byte
  514.           ----------------------------------------------------------------------
  515.           This routine returns the number of rows on the screen.  It is
  516.           completely independant of ScreenObj.Rows.
  517.      FASTSCRN documentation                                              Page 11
  518.  
  519.  
  520.           ----------------------------------------------------------------------
  521.           Function CurrentCols:Byte
  522.           ----------------------------------------------------------------------
  523.           This routine returns the number of columns on the screen.  It is
  524.           compoletely independant of ScreenObj.Cols.
  525.  
  526.  
  527.           ----------------------------------------------------------------------
  528.           Function CurrentVideoMode:Byte
  529.           ----------------------------------------------------------------------
  530.           This routine returns the current video mode.
  531.  
  532.  
  533.           ----------------------------------------------------------------------
  534.           Procedure SetVideoMode(Mode:Byte)
  535.           ----------------------------------------------------------------------
  536.           This routine sets the video mode to Mode.
  537.  
  538.  
  539.           ----------------------------------------------------------------------
  540.           Procedure SetCursor(Top, Bottom:Byte)
  541.           ----------------------------------------------------------------------
  542.           Sets the top scan line of the cursor to Top and the bottom scan line
  543.           to Bottom.
  544.  
  545.  
  546.           ----------------------------------------------------------------------
  547.           Function GetCursor:Word
  548.           ----------------------------------------------------------------------
  549.           Returns the top and bottom scan line of the cursor.  Hi(GetCursor) is
  550.           the Top and Lo(GetCursor) is the bottom.
  551.  
  552.  
  553.           ----------------------------------------------------------------------
  554.           Function WhereR:Byte
  555.           ----------------------------------------------------------------------
  556.           Returns the current row of the cursor.
  557.  
  558.  
  559.           ----------------------------------------------------------------------
  560.           Function WhereC:Byte
  561.           ----------------------------------------------------------------------
  562.           Returns of the current column of the cursor.
  563.      FASTSCRN documentation                                              Page 12
  564.  
  565.  
  566.           ----------------------------------------------------------------------
  567.           Procedure UsePage(Page:Byte)
  568.           ----------------------------------------------------------------------
  569.           Directs all reads, writes, and cursor locating routines to the video
  570.           page, Page.
  571.  
  572.  
  573.           ----------------------------------------------------------------------
  574.           Procedure DisplayPage(Page:Byte)
  575.           ----------------------------------------------------------------------
  576.           Displays the video page, Page.
  577.      FASTSCRN documentation                                              Page 13
  578.  
  579.  
  580.      Section Five: Examples
  581.      ------------- --------
  582.           Writing to the screen
  583.           ---------------------
  584.           Uses FastScrn, FastDef;
  585.  
  586.           Begin
  587.              With DisplayScreen Do Begin
  588.                 Fill(1,1,Rows,Cols,BlackBG+White,' ');
  589.                    (* Clears the screen and sets the using a black background
  590.                       and white foreground *)
  591.                 Write(1,1,BlackBG+White,'Hello');
  592.                    (* Places 'Hello' at row 1, column 1 in white letters on a
  593.                       black background *)
  594.                 Write(10,1,Red+DarkGrayBG,'world!');
  595.                    (* Places 'world!' at row 10, column 1 in red letters on a
  596.                       dark gray background *)
  597.              End;
  598.           End.
  599.  
  600.           Centering
  601.           ---------
  602.           Uses FastDef, FastScrn;
  603.  
  604.           Begin
  605.              With DisplayScreen Do
  606.                 WriteC(1, 1,Cols, BlackBG+White, 'Hello world!');
  607.                    (* Places 'Hello world!' centered between the first column
  608.                       and the last column on the screen *)
  609.           End.
  610.  
  611.  
  612.           SameColor/SameAttr
  613.           ------------------
  614.           Uses FastScrn, FastDef;
  615.  
  616.           Begin
  617.              With DisplayScreen Do Begin
  618.                 Color(1,1,Rows div 2,Cols,White+RedBG);
  619.                    (* Colors the top half of the screen with a white foreground
  620.                       and a red background *)
  621.                 Color((Rows div 2)+1,1,Rows div 2, Cols, BlackBG+Green);
  622.                    (* Colors the bottom half of the screen with a green
  623.                       forground and a black background *)
  624.                 WriteVC(1,Rows,Cols div 2,SameColor,'Hello world!');
  625.                    (* Centered vertically, 'Hello world!' appears, half in white
  626.                       on red and half in green on black *)
  627.              End;
  628.           End.
  629.  
  630.  
  631.           LastRow and LastCol
  632.           -------------------
  633.           Uses FastDef, FastScrn;
  634.  
  635.           Begin
  636.              With DisplayScreen Do Begin
  637.                 Write(1,1,SameColor,'Hello ');
  638.                 Write(LastRow, LastCol, SameColor, 'world!');
  639.      FASTSCRN documentation                                              Page 14
  640.  
  641.  
  642.                    (* Places 'world!' next to 'Hello ' using the previous screen
  643.                       color *)
  644.              End;
  645.           End.
  646.  
  647.  
  648.           Copying to and from screens
  649.           ---------------------------
  650.           Uses FastScrn, FastDef;
  651.  
  652.           Var
  653.              MemoryScreen : ScreenObj;
  654.  
  655.           Begin
  656.              With MemoryScreen Do Begin
  657.                 Init;
  658.                 Rows:=10; Cols:=10;
  659.                 GetMem(ScrPtr, Rows*Cols*2);
  660.                    (* Get enough memory for the screen.  Multiply by 2 because
  661.                       each character on the screen consists of two bytes *)
  662.  
  663.                 Fill(1,1,Rows,Cols,White+BlueBG,'*');
  664.                    (* Fill MemoryScreen with astericks *)
  665.                 Write(1,1,SameColor,'This is the memory screen');
  666.                    (* Put 'This is the memory screen' into MemoryScreen in white
  667.                       on a blue background.          FastScrn automatically
  668.                       takes care of wrapping the text *)
  669.              End;
  670.  
  671.              With DisplayScreen Do Begin
  672.                 Fill(1,1,Rows,Cols,BlackBG+White,' ');
  673.                    (* Clear the screen *)
  674.                 Copy(MemoryScreen,1,1, MemoryScreen.Rows,MemoryScreen.Cols,
  675.                      1,15);
  676.                    (* Copies the memory screen to row 1, column 15 of the
  677.                       display screen *)
  678.              End;
  679.           End.
  680.      FASTSCRN documentation                                              Page 15
  681.  
  682.  
  683.      Section Six: Public Domain
  684.      ------------ -------------
  685.           This software is hereby released into the public domain to do with it
  686.           as it will.  If you have any ideas for extending FASTSCRN or modifying
  687.           it in some way, I want to hear from you.  Also, if you have any
  688.           questions or comments about FASTSCRN, please let me know.
  689.  
  690.           Mark Addleman
  691.           [72777, 740]
  692.  
  693.          ----------------end-of-author's-documentation---------------
  694.  
  695.                         Software Library Information:
  696.  
  697.                    This disk copy provided as a service of
  698.  
  699.                         The Public (Software) Library
  700.  
  701.          We are not the authors of this program, nor are we associated
  702.          with the author in any way other than as a distributor of the
  703.          program in accordance with the author's terms of distribution.
  704.  
  705.          Please direct shareware payments and specific questions about
  706.          this program to the author of the program, whose name appears
  707.          elsewhere in  this documentation. If you have trouble getting
  708.          in touch with the author,  we will do whatever we can to help
  709.          you with your questions. All programs have been tested and do
  710.          run.  To report problems,  please use the form that is in the
  711.          file PROBLEM.DOC on many of our disks or in other written for-
  712.          mat with screen printouts, if possible.  The P(s)L cannot de-
  713.          bug programs over the telephone.
  714.  
  715.          Disks in the P(s)L are updated monthly, so if you did not get
  716.          this disk  directly from the P(s)L,  you should be aware that
  717.          the files in this set may no  longer be the current versions.
  718.  
  719.          For a copy of the latest monthly software library newsletter
  720.          and a list of the 1,800+ disks in the library, call or write
  721.  
  722.                         The Public (Software) Library
  723.                               P.O.Box 35705 - F
  724.                            Houston, TX 77235-5705
  725.                                (713) 665-7017
  726.  
  727.